package com.bang.itstack.day10;


/**
 * @ClassName: Computer
 * @Desc: TODO
 * @author: <Bang>
 * @Date: 2021/10/22 14:58
 * @Version: 1.0
 * @Modified By:
 */
public class Computer implements Function{

    private Cpu cpu;

    private Disk disk;

    private Memory memory;

    public Computer(){
        cpu = new Cpu();
        memory = new Memory();
        disk = new Disk();
    }

    @Override
    public void startup() {
        System.out.println("start the computer!");
        cpu.startup();
        memory.startup();
        disk.startup();
        System.out.println("start computer finished!");
    }

    @Override
    public void shutdown() {
        System.out.println("begin to close the computer!");
        cpu.shutdown();
        memory.shutdown();
        disk.shutdown();
        System.out.println("computer closed!");
    }
}
